import { request } from './request'
let token = 'meQebIujrPYlQi8/9rOZ7RhCq2ZHZrE3Lrett1fUHP3eOZP5A3AtLUbd6Pk/+ghLJbTKRiEhdgpe9i6rRrn/IRUBMILx3odDBxObbR0sxgVnxhAmWpUXPNmr3yQ1aTQdchJNJVjIXLFa6u3vv0/Ucg=='
export default {
  // 登录
  Carouselchart: (data) => {
    return request({
      url: '?c=apidata&m=api&org=1&name=Carouselchart&type=json&key=hooyn',
      method: 'post',
      data,
    })
  },
  // 发现活动
  DiscoveryActivities: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=DiscoveryActivities&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },

  // 党建服务
  buildingservices: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=buildingservices&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 详情
  activedetails: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=activedetails&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 企业风采
  CorporateStyle: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=CorporateStyle&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 企业详情
  Enterprisedetails: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Enterprisedetails&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  Enterpriseproducts: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Enterpriseproducts&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 特色园区
  FeaturedPark: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=FeaturedPark&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  //园区详情
  Detailsofthepark: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Detailsofthepark&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 找空间
  Findspace: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Findspace&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 人才
  HumanResources: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=HumanResources&type=json&key=hooyn&size=100`,
      method: 'post',
      data,
    })
  },
  ChineMap: (data) => {
    return request({
      url: `chine-map.json`,
      method: 'get',
      data,
    })
  },
  // 党建服务详情
  buildingservicesitem: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=buildingservicesitem&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },

  // AI智能助手
  OpenAi: (data) => {
    return request({
      url: `a/openai/chat/`,
      method: 'post',
      data,
      header: {
        'content-type': 'application/json',
      },
      timeout: 300000,
    })
  },
  // AI设计助手
  TextgeneratedImg: (data) => {
    return request({
      // url: 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis',
      url: '/api/v1/services/aigc/text2image/image-synthesis',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
        Authorization: 'Bearer sk-76e800880b2d4c53a1c676e6fe1b780b',
        'X-DashScope-Async': 'enable',
      },
      data,
    })
  },
  // AI设计助手第二部
  GetAIimg: (data) => {
    return request({
      // url: `https://dashscope.aliyuncs.com/api/v1/tasks/${data.task_id}`,
      url: `/api/v1/tasks/${data.task_id}`,
      method: 'get',
      headers: {
        Authorization: 'Bearer sk-76e800880b2d4c53a1c676e6fe1b780b',
      },
    })
  },

  // 付款申请单
  Payment: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Payment&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 发起报销
  Expense: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=Expense&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 附件
  upliadFile: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=upliadFile&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 提交风味列表
  getProductName: (data, query = { size: 20, page: 0}) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=getTeaFlavor&type=json&key=hooyn&size=${query.size}&page=${query.page}`,
      method: 'post',
      data
    })
  },
  // 风味查询编号 
  getBasicData: (data, query = { size: 20, page: 0}) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=getBasicData&type=json&key=hooyn&size=${query.size}&page=${query.page}`,
      method: 'post',
      data
    })
  },
  
   // 风味
   UpdateTeaFlavor: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=UpdateTeaFlavor&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 报销人
  getExpense: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=getExpense&type=json&key=hooyn&size=100`,
      method: 'post',
      data,
    })
  },
  // 部门
  getDepartment: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=getDepartment&type=json&key=hooyn&size=100`,
      method: 'post',
      data,
    })
  },
  // 供应商
  getSupplier: (data, query = { size: 20, page: 0}) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=GetSupplier&type=json&key=hooyn&size=${query.size}&page=${query.page}`,
      method: 'post',
      data,
    })
  },
  // 供应商新增品名基础信息
  UpdateSupplierData: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=UpdateSupplierData&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  // 客户新增品名基础信息
  UpdateCustomData: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=UpdateCustomData&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  getEnum: (data) => {
    return request({
      url: `?c=apidata&m=api&org=1&name=getEnum&type=json&key=hooyn`,
      method: 'post',
      data,
    })
  },
  /** ai对话 ***/  
  // 获取历史对话 勾
  aiChatDetail: (data) => {
    return request({
      url: `chat/detail`,
      method: 'post',
      data,
      type: 'ai',
      headers: {
        'X-User-Token-Context': token,
      },
    })
  },
  // 获取对话列表 勾
  aiChatList: (data) => {
    return request({
      url: `chat/list`,
      method: 'post',
      data,
      type: 'ai',
      headers: {
        'X-User-Token-Context': token,
      },
    })
  },
  // 创建对话 勾
  aiChatCreate: (data) => {
    return request({
      url: `chat/create`,
      method: 'post',
      data,
      type: 'ai',
      headers: {
        'X-User-Token-Context': token,
      }
    })
  },
  // 编辑对话设置 勾
  aiChatEdit: (data) => {
    return request({
      url: `chat/edit`,
      method: 'post',
      data,
      type: 'ai',
      headers: {
        'X-User-Token-Context': token,
      }
    })
  },
  // 删除对话 勾
  aiChatDelete: (data) => {
    return request({
      url: `chat/delete`,
      method: 'post',
      data,
      type: 'ai',
      headers: {
        'X-User-Token-Context': token,
      }
    })
  },


}
